/*********************************************************************\
*
*                  (c) lkc
*                  All Rights Reserved. lkc Confidential
*
\*********************************************************************/
/*********************************************************************\
*   Title                      :
*
*   Module Description         :
*
*   Author                     : lkc
*
*   Created                    : 2018-6-24
*
\*********************************************************************/
#ifndef SERIALPORT_POSIX_H
#define SERIALPORT_POSIX_H

#include <string>
#include <termios.h>    /*PPSIX 终端控制定义*/
#include "CommBasePosix.h"

class SerialPortPosix : public CommBasePosix
{
public:
    SerialPortPosix(const std::string devName);
    bool Open() override;
    bool SetOpt(speed_t speed,int flowCtrl,int databits,int stopbits,int parity);
    int Send(const unsigned char *sendBuf, const int dataLen) override;
private:
    int Read(unsigned char * readbuf, const int dataLen) override;
private:
    std::string m_devName;
};

#endif // SERIALPORT_POSIX_H

/********************************************************************\
 *
 * REVISION RECORDS
 *
\*********************************************************************/
/*********************************************************************/
/*
 *
 *
 *
\*********************************************************************/
/*------------------------------The End------------------------------*/
